//Original source: http://www.codeproject.com/KB/aspnet/validation_engine.aspx
using System;

namespace Jaws.Core.Web.Entities.Validation.CustomAttributes
{
    [AttributeUsage(AttributeTargets.Property)]
    public class NotNullOrEmptyAttribute : ValidationAttribute
    {
        public NotNullOrEmptyAttribute()
        {
            Message = ValidationMessages.NotNullOrEmpty;
        }

        public override bool IsValid(object item)
        {
            if (String.IsNullOrEmpty((string) item))
                return false;

            return true;
        }
    }
}